package fell01;

public class Person {
    private int age;

    public void setAge(int age){
        if (age>=0&&age<100){
            this.age=age;
            System.out.println("年龄合法");
        } else {
            System.out.println("年龄不合法，请输入1-100的整数");

        }
    }

    public int getAge() {
        return age;
    }
    public static void main(String[]agse){
         Person person=new Person();
         person.setAge(36);
         System.out.println("年龄为："+person.getAge());
    }
}
